package cn.kent.controller;

import cn.kent.config.RabbitConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/send")
    public void hello(){
        rabbitTemplate.convertAndSend(RabbitConfig.MSG_EXCHANGE_NAME, RabbitConfig.MSG_QUEUE_NAME, "hello");
    }
}
